<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"/>
	<meta charset="UTF-8"/>

<!--框架开始-->

<script>
 var v;
$(function(){
  v = new Vue({
		el: '#left',
		data: {
			tab:isEmpty(sessionStorage.getItem("tab"))?'1':sessionStorage.getItem("tab"),
			isLogin:'false'
		},
		methods: {
			exitProcess:function(type){
				$.showConfirm({'title':'','data':{'type':type},'content':'是否离开当前界面？',"showClose":false,"sureLabel":"否","cancelLabel":"是",'cancel':_sureExit});
			}
		},
		ready: function() {
			showtime();
			var userId = sessionStorage.getItem("userId");
			if(isNotEmpty(userId)){
				this.isLogin = 'true';
			}
		}
	});
});


function _sureExit(type){
	doMask();
	if(type == null || type == "" ){
		var type = "index";
	}else{
		var type = type.type;
	}
	_processSureExit(type);
	
}

function _processSureExit(type){
	if(sessionStorage.getItem('isFace')==1){
		cleanFace();
	}
    if(type == 'index'){
    	if(isEmpty(sessionStorage.getItem('userId'))){
    		offLine();
    	}
        _toIndex();
      }else if(type =="myspace"){
        _toSpace();
       }else if(type=="convenient"){
        _toBianmin();
       }else if(type=="scanner"){
       	_toScanner();
       }else if(type=="gover"){
       	_toZhenwu();
     }
}


//首页
function _toIndex(){
	toLocation("../gover/index.html");
}
//政务服务
function _toZhenwu(){
	sessionStorage.setItem("tab","1");
	if(v.isLogin=='true'){
		toLocation("../gover/selfHelpBusinessChoose.html");
	}else{
		toLocation("../gover/readIdentityCard.html");
	}
    
}
function _toSpace(){
	sessionStorage.setItem("tab","2");
	if(v.isLogin=='true'){
		toLocation("../space/home.html");
	}else{
		toLocation("../gover/readIdentityCard.html?fromSpace=1");
	}
}
//便面服务
function _toBianmin(){
	sessionStorage.setItem("tab","3");
	toLocation("../convenient/convenient-index.html");
}
//便面服务
function _toScanner(){
	sessionStorage.setItem("tab","4");
	toLocation("../gover/scannerIndex.html");
}
function toLocation(location){
	window.location=location;
}
function showtime(){
	//当前时间显示
		var today;  
		var hour;  
		var second;  
		var minute;  
		var year;  
		var month;  
		var date;  
		var strDate;   
		today=new Date();   
		var n_day = today.getDay();   
		switch (n_day)   
		{   
			case 0:{   
			strDate = "星期日";
			}break;   
			case 1:{   
			strDate = "星期一";
			}break;   
			case 2:{   
			strDate ="星期二";
			}break;   
			case 3:{   
			strDate = "星期三"; 
			}break;   
			case 4:{   
			strDate = "星期四";  
			}break;   
			case 5:{   
			strDate = "星期五";  
			}break;   
			case 6:{   
			strDate = "星期六"; 
			}break;   
			case 7:{   
			strDate = "星期日";  
			}break;   
		}   
		year = today.getYear()+1900;   
		month = today.getMonth()+1;   
		date = today.getDate();   
		hour = today.getHours();   
		minute =today.getMinutes();   
		second = today.getSeconds();   
		if(month<10) month="0"+month;   
		if(date<10) date="0"+date;   
		if(hour<10) hour="0"+hour;   
		if(minute<10) minute="0"+minute;   
		if(second<10) second="0"+second;  
		$(".dataitem-title1").html(hour + ":" + minute);
		$(".dataitem-title2").html(year + "-" + month + "-" + date+" " + strDate);
		$(".index-title1").html(hour + ":" + minute);
		$(".index-title2").html(year + "-" + month + "-" + date+" "+strDate)
		setTimeout("showtime();", 1000);   
}
</script>

<title>一体机</title>
</head>
<body id = "v">

				<div class="yl-main-item dateitem">
					<div class="dataitem-title1"></div>
					<div class="dataitem-title2"></div>
				</div>
				<div class="yl-main-item main-item1 m_scole" @click="exitProcess('index')">
					<a class="txt">首页</a>
				</div>
				
				<div class="yl-main-item main-item4 m_scole "  @click="exitProcess('gover')" v-show="tab!='1'">
					<span class="txt">政务服务</span></div>
					
				<div class="yl-main-item main-item1 main-item2 m_scole" @click="exitProcess('scanner')" v-show="tab!='4'">
					<span class="txt">扫码查询</span></div>
				<div class="yl-main-item main-item1 main-item3 m_scole" @click="exitProcess('convenient')" v-show="tab!='3'">
					<span class="txt">便民服务</span></div>
				<div class="yl-main-item main-item5 m_scole" @click="exitProcess('myspace')" v-show="tab!='2'">
					<span class="txt">我的空间</span>
				</div>
				<div class="yl-main-item main-item6 m_scole" @click="exitProcess('index')" v-show="isLogin=='true'">
					<span class="txt">退出办理</span>
				</div>
</body>
</html>